﻿using System;
using System.Threading.Tasks;
using TwitterRtLibrary;
using Windows.UI.Xaml.Controls;

namespace TwitterRtDemoApp
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            TwitterRt = new TwitterRt("consumerKey goes here", "consumerSecret goes here", "callbackUrl goes here");
        }

        private async void OnAuthorize(object sender, Windows.UI.Xaml.RoutedEventArgs args)
        {
            await TwitterRt.GainAccessToTwitter();
            _statusTextBlock.Text = TwitterRt.Status;
        }

        private async void OnTweet(object sender, Windows.UI.Xaml.RoutedEventArgs args)
        {
            await TwitterRt.UpdateStatus("Hello From TwitterRt " + DateTime.Now);
            _statusTextBlock.Text = TwitterRt.Status;
        }

        public TwitterRt TwitterRt { get; private set; }
    }
}
